package com.xingfly.config;

import com.xingfly.security.jwt.resolvers.CurrentUserResolvers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import java.util.List;

/**
 * Created by SuperS on 22/12/2016.
 */
@Configuration
public class WebMvcConfig extends WebMvcConfigurerAdapter {

    @Autowired
    private CurrentUserResolvers currentUserResolvers;

    //设置注解拦截 直接通过 注解 将值注入到 变量中
    @Override
    public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
        argumentResolvers.add(currentUserResolvers);
    }
}
